package main

import (
	"encoding/json"
	"github.com/lib/pq"
)

// Command "project" specify your project to generate
// Field Rule tag
// Except rule tag any others tag will be as fields tag. for example: you use http parameter validator
// Parameter: represent this field is a parameter
// Required: represent this field is required parameter
// AutoGenGormTag: generator will auto generate gorm's tag. if not specify this rule and not specify gorm's or others orm's tag the field's tag will be empty
// NameStyle: you can specify the json tag naming style as snake_case or camelCase or you can directly specify json tag
// EnableValidator: enable http parameter validator, but you must specify validator tag. if you have no this validator tag EnableValidator is invalid

//generate:bll;model;entity;api.http;store.postgres
//project:pay
type FeePlan struct {
	Id        int64           `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	Name      string          `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	Type      int             `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	Enable    int             `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	Packs     json.RawMessage `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	CreatedAt int64           `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	UpdatedAt int64           `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
}

//generate:bll;model;entity;api.http;store.postgres
//project:pay
type FeePlanGroup struct {
	Id         int64         `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	Name       string        `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	Remark     string        `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	FeePlanIds pq.Int64Array `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	Def        int           `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	Enable     int           `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	CreatedAt  int64         `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	UpdatedAt  int64         `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
}

//generate:bll;model;entity;api.http;store.postgres
//project:pay
type FeePlanGroupObject struct {
	Id        int64           `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	Detail    json.RawMessage `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	GroupId   int64           `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	ObjectId  int64           `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	CreatedAt int64           `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	UpdatedAt int64           `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
}

//generate:bll;model;entity;api.http;store.postgres
//project:pay
type FeePlanPaymentOrder struct {
	Id             int64  `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	TradeNo        string `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	UserId         int64  `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	UserName       string `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	UserPhone      string `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	EbikeId        int64  `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	EbikeName      int64  `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	EbikeSnCode    string `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	EbikeTypeId    string `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	EbikeTypeName  string `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	Status         string `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	Description    string `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	FeePlanId      int64  `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	FeePlanGroupId int64  `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	FeePlanPackNo  int    `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	Money          int    `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	CallBackCnt    int    `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	Channel        string `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	CallBackData   string `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	TransactionId  string `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	CreatedAt      int64  `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	UpdatedAt      int64  `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
}
